package com.xiaoma.dateutil;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;

/**
 * @ClassName Test
 * @Description
 * @date 2020-11-21 17:15
 */
public class DateTest {

  public static void main(String[] args) {
    DateTime dateTime = DateUtil.offsetDay(DateUtil.parse("2020-02-03"), -1);
    DateTime dateTime1 = DateUtil.beginOfDay(dateTime);
    DateTime dateTime2 = DateUtil.endOfDay(dateTime);
    String today = DateUtil.today();
    System.out.println("today:"+today);

    String format = DateUtil
        .format(DateUtil.beginOfDay(dateTime2), DatePattern.NORM_DATE_FORMAT.getPattern());
    System.out.println(format);
    System.out.println(dateTime1);
    System.out.println(dateTime2);
  }
}
